-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Legalhold for large teams (>2000) #1546
Conversation
14e3efb
to
fc77d89
Compare
fc77d89
to
49bdb5d
Compare
49bdb5d
to
6b23e7a
Compare
|
@@ -142,6 +143,14 @@ removeSettings zusr tid (Public.RemoveLegalHoldSettingsRequest mPassword) = do | |||
void $ permissionCheck ChangeLegalHoldTeamSettings zusrMembership | |||
ensureReAuthorised zusr mPassword | |||
removeSettings' tid | |||
where | |||
assertNotWhitelisting :: Galley () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to rename this to assertNoSettingsWhitelist
, but I'll try to control myself.
@@ -18,6 +17,7 @@ | |||
-- | |||
-- You should have received a copy of the GNU Affero General Public License along | |||
-- with this program. If not, see <https://www.gnu.org/licenses/>. | |||
{-# OPTIONS_GHC -Wno-unused-top-binds #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can avoid this by wrapping the test lines 156, 157 below into when False
rather than removing them completely. But not now.
\(the 'withLHWhitelist' trick does not work because it does not allow \ | ||
\brig to talk to the dynamically spawned galley)." | ||
FeatureLegalHoldDisabledByDefault -> | ||
liftIO $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deduplicate this block. (not now)
(tid, _owner, _others) <- createBindingTeamWithMembers (fanoutLimit + 1) | ||
-- TODO: it is impossible in this test to create teams bigger than the fanout limit. | ||
-- Change the +1 to anything else and look at the logs | ||
(tid, _owner, _others) <- createBindingTeamWithMembers (fanoutLimit + 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this TODO. Or why you changed the +1
to +5
.
@@ -667,6 +691,44 @@ testAddTeamUserTooLargeWithLegalhold = do | |||
const 403 === statusCode | |||
const (Just "too-many-members-for-legalhold") === fmap Error.label . responseJsonMaybe | |||
|
|||
-- | This test only works if you manually adjust the server config files (the 'withLHWhitelist' trick does not work because it does not allow brig to talk to the dynamically spawned galley). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first line of this haddocks is redundant.
limit <- fromIntegral . fromRange <$> fanoutLimit | ||
let withinLimit = teamSize <= limit | ||
view (options . Opts.optSettings . Opts.setFeatureFlags . flagLegalHold) >>= \case | ||
FeatureLegalHoldDisabledPermanently -> pure withinLimit | ||
FeatureLegalHoldDisabledByDefault -> pure withinLimit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
limit <- fromIntegral . fromRange <$> fanoutLimit | |
let withinLimit = teamSize <= limit | |
view (options . Opts.optSettings . Opts.setFeatureFlags . flagLegalHold) >>= \case | |
FeatureLegalHoldDisabledPermanently -> pure withinLimit | |
FeatureLegalHoldDisabledByDefault -> pure withinLimit | |
let withinLimit = (teamSize <=) . fromIntegral . fromRange <$> fanoutLimit | |
view (options . Opts.optSettings . Opts.setFeatureFlags . flagLegalHold) >>= \case | |
FeatureLegalHoldDisabledPermanently -> withinLimit | |
FeatureLegalHoldDisabledByDefault -> withinLimit |
https://wearezeta.atlassian.net/browse/SQSERVICES-410